<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'adminMod.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
<!--框架必需start-->
<script type="text/javascript" src="ui/js/jquery.js"></script>
<script type="text/javascript" src="ui/js/framework.js"></script>
<link href="ui/css/import_basic.css" rel="stylesheet" type="text/css"/>
<link rel="stylesheet" type="text/css" id="skin" prePath="/"/>
<link rel="stylesheet" type="text/css" id="customSkin"/>
<link href="ui/skins/blue/style.css" rel="stylesheet" type="text/css" id="theme" themeColor="blue"/>
<!--框架必需end-->
<body>
	 
	<div class="box2" panelTitle="添加警告" style="margin-left: auto;margin-right: auto;float: left;width: 100%;">
		<fieldset>
			<form action="addWaring.action" method="post" class="registerform">
		<table class="tableStyle" formMode="transparent" >
			<tr>
				<td>sign:</td>
				<td><input type="text" id="sign" name="waring.sign" datatype="s6-18" /></td>			
			</tr>
			<tr>	
				<td>value:</td>
				<td><input type="text" id="value" name="waring.value" datatype="*6-15"/></td>	
			</tr>	
			<tr id="taskkind">	
				<td>监控类型:</td>
						 		<td>
									<select id="sel-15" keepDefaultStyle="true" name="waring.taskKind.tkId" >
										<s:iterator value="taskKindList" var="tkl">
											 <option value="<s:property value="#tkl.tkId"/>">
											 	<s:property value="#tkl.tkName"/>
											 </option>
										</s:iterator>
									</select>
								</td>
			</tr>
			<tr>
				<td>
					<input type="submit" value="提交"/>
				</td>
			</tr>
		</table>
		</form>
		 </fieldset>
	</div>	
	
	<div id="scrollContent" style="float: left;width: 100%">
	<table class="tableStyle" useClick="false" id="list" style="text-align: center;">
			<tr>
				<th width="5%">id</th>
				<th width="10%">takkind</th>
				<th width="10%">sign</th>
				<th width="20%">value</th>
				<th width="20%">操作</th>
			</tr>
			
			<s:iterator value="waringList"  var="wl">
				<tr>
				<td><s:property value="#wl.wId"/></td>
				<td><s:property value="#wl.taskKind.tkName"/></td>
				<td><s:property value="#wl.sign"/></td>
				<td><s:property value="#wl.value"/></td>
				<td><span class="img_edit hand" title="修改"></span><span class="img_delete hand"  title="删除"></span></td>
			</tr>
			</s:iterator>		
		</table>	
	</div>
	<s:set value="#addFlag" name="flag"></s:set>
	<s:if test="flag==0">
		111
	</s:if>
	<script>
		var id;
		var adminName;
		var email;
		var phoneNumber;
		var roles;
		var managementStation;
		var $currentTr;
		$(function(){
			$(".img_btn_up").click(function(){
				upHandler($(this));
			});
			$(".img_delete").click(function(){
				delHandler($(this));
			});
			$(".img_edit").click(function(){
				modiHandler($(this));
			});
		});
		//删除行
		function delHandler($obj){
			top.Dialog.confirm("确定要删除吗？",function(){
				id=$obj.parents("tr").find("td").eq(0).html();
				location.href='adminDel.action?adminId='+id;
			});
		}	
		
		function modiHandler($obj){		
			var adminId=$obj.parents("tr").find("td").eq(0).html();
			location.href='getAdminById.action?adminId='+adminId;
		}			
		//修改赋值
		function refreshRow(val0,val1,val2,val3){
			$currentTr.find("td").eq(0).html(val0);
			$currentTr.find("td").eq(1).html(val1);
			$currentTr.find("td").eq(2).html(val2);
			$currentTr.find("td").eq(3).html(val3);
		}
		
		function select(){
			var id = $("#role").val();
			if(id==1){
				$("#ms").css("visibility","hidden");
			}else{
				$("#ms").css("visibility","visible");
				}
			}
	</script>
</body>
</html>
